//
//  CenterView.m
//  SUZHOUBANK
//
//  Created by saberLily on 16/4/14.
//  Copyright © 2016年 RuiFeng-WGCC. All rights reserved.
//

#import "CenterView.h"
#define TitleViewWidth 40
#define LipLine 20
@interface CenterView()
@property (nonatomic,strong) UIImageView *lineImage; /**< 背景线 */
@end
@implementation CenterView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initializeDataSource];
        [self initializeUserInterface];

    }
    return self;
}

#pragma mark - initializeDataSource 初始化数据源
-(void)initializeDataSource{
    
}

#pragma mark - initializeUserInterface 初始化用户界面
-(void)initializeUserInterface{
    [self addSubview:self.lineImage];
    [self addSubview:self.titleImage];
    [self addSubview:self.titleLabel];
    [self addSubview:self.rightView];
}

#pragma mark *** PrivateMethods ***


#pragma mark *** getters ***
-(UIImageView *)titleImage{
    if (!_titleImage) {
        _titleImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, LipLine, TitleViewWidth, TitleViewWidth)];
    }
    return _titleImage;
}
-(UILabel *)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.titleImage.frame), LipLine, 100, TitleViewWidth)];
    }
    return _titleLabel;
}
-(UIImageView *)rightView{
    if (!_rightView) {
        _rightView = [[UIImageView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.bounds)-50, LipLine, TitleViewWidth*1.2, TitleViewWidth*1.2)];
        
    }
    return _rightView;
}
-(UIImageView *)lineImage{
    if (!_lineImage) {
        _lineImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds), 2)];
        _lineImage.image = [UIImage imageNamed:@"金融资讯_线"];
    }
    return _lineImage;
}


@end
